home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update20.zoo / gprof / diffs
Encoding:
Text File  |  1992-04-19  |  14.4 KB  |  681 lines

  1. *** 1.7    1992/03/18 03:41:26
  2. --- Changelog    1992/04/19 16:55:39
  3. ***************
  4. *** 51,53 ****
  5. --- 51,58 ----
  6.       various fixes from the net. gprof -s should work better now.
  7.   
  8.   ------------------------------- Patchlevel 6 ---------------------------
  9. + cplusdem.c:: ++jrb
  10. +         fix up demangler as per util diffs
  11. + ------------------------------- Patchlevel 7 ---------------------------
  12. *** 1.8    1992/03/18 03:41:26
  13. --- PatchLev.h    1992/04/19 16:55:40
  14. ***************
  15. *** 1,4 ****
  16. ! #define    PatchLevel "06"
  17.   
  18.   /*
  19.    *    the Patch Level above is to identify the version
  20. --- 1,4 ----
  21. ! #define    PatchLevel "07"
  22.   
  23.   /*
  24.    *    the Patch Level above is to identify the version
  25. *** 1.1    1992/03/08 17:48:29
  26. --- cplusdem.c    1992/04/19 16:55:40
  27. ***************
  28. *** 166,171 ****
  29. --- 166,177 ----
  30.     "cm", ",",            /* ansi */
  31.     "nop", "",            /* old (for operator=) */
  32.     "as", "=",            /* ansi */
  33. +   "cond", "?:",            /* old */
  34. +   "cn", "?:",            /* psuedo-ansi */
  35. +   "max", ">?",            /* old */
  36. +   "mx", ">?",            /* psuedo-ansi */
  37. +   "min", "<?",            /* old */
  38. +   "mn", "<?",            /* psuedo-ansi */
  39.   };
  40.   
  41.   /* Beware: these aren't '\0' terminated. */
  42. ***************
  43. *** 186,194 ****
  44.   static void string_appends (string *p, string *s);
  45.   static void string_appendn (string *p, const char *s, int n);
  46.   static void string_prepend (string *p, const char *s);
  47. - #if 0
  48.   static void string_prepends (string *p, string *s);
  49. - #endif
  50.   static void string_prependn (string *p, const char *s, int n);
  51.   static int get_count (const char **type, int *count);
  52.   static int do_args (const char **type, string *decl);
  53. --- 192,198 ----
  54. ***************
  55. *** 195,200 ****
  56. --- 199,207 ----
  57.   static int do_type (const char **type, string *result);
  58.   static int do_arg (const char **type, string *result);
  59.   static int do_args (const char **type, string *decl);
  60. + static int do_cuv_prefix (const char **type, string *result, int *non_empty);
  61. + static int do_builtin_type (const char **type, string *result, int *non_empty);
  62. + static int do_template_args (const char **type, string *result);
  63.   static void munge_function_name (string *name);
  64.   static void remember_type (const char *type, int len);
  65.   #else
  66. ***************
  67. *** 214,219 ****
  68. --- 221,229 ----
  69.   static int do_type ();
  70.   static int do_arg ();
  71.   static int do_args ();
  72. + static int do_cuv_prefix ();
  73. + static int do_builtin_type ();
  74. + static int do_template_args ();
  75.   static void munge_function_name ();
  76.   static void remember_type ();
  77.   #endif
  78. ***************
  79. *** 275,286 ****
  80.         destructor = 1;
  81.         p = type;
  82.       }
  83. -       /* static data member */
  84. -       else if (*type != '_' && (strchr (type, CPLUS_MARKER) != NULL))
  85. -     {
  86. -       static_type = 1;
  87. -       p = type;
  88. -     }
  89.         /* virtual table "_vt$"  */
  90.         else if (type[0] == '_' && type[1] == 'v' && type[2] == 't' && type[3] == CPLUS_MARKER)
  91.       {
  92. --- 285,290 ----
  93. ***************
  94. *** 290,295 ****
  95. --- 294,305 ----
  96.         strcat (tem, " virtual table");
  97.         return tem;
  98.       }
  99. +       /* static data member */
  100. +       else if (type[0] == '_' && type[1] != '_' && (strchr (type, CPLUS_MARKER) != NULL))
  101. +     {
  102. +       static_type = 1;
  103. +       p = type + 1;
  104. +     }
  105.         else return NULL;
  106.       }
  107.   
  108. ***************
  109. *** 323,334 ****
  110.         string_appendn (&decl, "", 1);
  111.         munge_function_name (&decl);
  112.         if (decl.b[0] == '_')
  113. !         {
  114. !           string_delete (&decl);
  115. !           return NULL;
  116. !         }
  117. !       else
  118. !         p += 2;
  119.       }
  120.         else
  121.       {
  122. --- 333,340 ----
  123.         string_appendn (&decl, "", 1);
  124.         munge_function_name (&decl);
  125.         if (decl.b[0] == '_')
  126. !         decl.p--;
  127. !       p += 2;
  128.       }
  129.         else
  130.       {
  131. ***************
  132. *** 351,363 ****
  133.       {
  134.       case 'C':
  135.         /* a const member function */
  136. !       if (!isdigit (p[1]))
  137.       {
  138.         string_delete (&decl);
  139.         return NULL;
  140.       }
  141. -       p += 1;
  142. -       const_flag = 1;
  143.         /* fall through */
  144.       case '0':
  145.       case '1':
  146. --- 357,371 ----
  147.       {
  148.       case 'C':
  149.         /* a const member function */
  150. !       p += 1;
  151. !       const_flag = 1;
  152. !       if (*p == 't')
  153. !     goto template;
  154. !       if (!isdigit (*p))
  155.       {
  156.         string_delete (&decl);
  157.         return NULL;
  158.       }
  159.         /* fall through */
  160.       case '0':
  161.       case '1':
  162. ***************
  163. *** 416,597 ****
  164.         break;
  165.       /* template additions */
  166.       case 't':
  167.         p += 1;
  168.         {
  169. !     int r, i;
  170. !     int non_empty = 0;
  171.       string tname;
  172.       string trawname;
  173.       
  174. -     string temp;
  175. -     int need_comma = 0;
  176. -     
  177.       string_init(&tname);
  178.       string_init(&trawname);
  179. !     
  180.       /* get template name */
  181.       if (!get_simple_count (&p, &r))
  182.         {
  183. !         string_delete (&decl);
  184. !         return 0;
  185.         }
  186.       string_appendn (&tname, p, r);
  187.       string_appendn (&trawname, p, r);
  188. -     string_appendn (&trawname, "", 1);
  189.       p += r;
  190.       string_append (&tname, "<");
  191. !     /* get size of template parameter list */
  192. !     if (!get_count (&p, &r))
  193. !       return 0;
  194. !     for (i = 0; i < r; i++)
  195.         {
  196. !         if (need_comma)
  197. !           string_append (&tname, ", ");
  198. !         /* Z for type parameters */
  199. !         if (*p == 'Z')
  200. !           {
  201. !         p += 1;
  202. !         
  203. !         success = do_type (&p, &temp);
  204. !         string_appendn (&temp, "", 1);
  205. !         if (success)
  206. !           string_append (&tname, temp.b);
  207. !         string_delete(&temp);
  208. !         if (!success)
  209. !           break;
  210. !           }
  211. !         /* otherwise, value parameter */
  212. !         else
  213. !           {
  214. !         const char *old_p  = p;
  215. !         int is_pointer = 0;
  216. !         int is_real = 0;
  217. !         int is_integral = 0;
  218. !         int done = 0;
  219. !         success = do_type (&p, &temp);
  220. !         string_appendn (&temp, "", 1);
  221. !         if (success)
  222. !           string_append (&tname, temp.b);
  223. !         string_delete(&temp);
  224. !         if (!success)
  225. !           break;
  226. !         string_append (&tname, "=");
  227. !         while (*old_p && !done)
  228. !           {    
  229. !             switch (*old_p)
  230. !               {
  231. !               case 'P':
  232. !               case 'R':
  233. !             done = is_pointer = 1;
  234. !             break;
  235. !               case 'C':    /* const */
  236. !               case 'U':    /* unsigned */
  237. !               case 'V':    /* volatile */
  238. !               case 'F':    /* function */
  239. !               case 'M':    /* member function */
  240. !               case 'O':    /* ??? */
  241. !             old_p++;
  242. !             continue;
  243. !               case 'Q':    /* repetition of following */
  244. !               case 'T':    /* remembered type */
  245. !             abort();
  246. !             break;
  247. !               case 'v':    /* void */
  248. !             abort();
  249. !             break;
  250. !               case 'x':    /* long long */
  251. !               case 'l':    /* long */
  252. !               case 'i':    /* int */
  253. !               case 's':    /* short */
  254. !               case 'c':    /* char */
  255. !             done = is_integral = 1;
  256. !             break;
  257. !               case 'r':    /* long double */
  258. !               case 'd':    /* double */
  259. !               case 'f':    /* float */
  260. !             done = is_real = 1;
  261. !             break;
  262. !               default:
  263. !             abort();
  264. !               }
  265. !           }
  266. !         if (is_integral)
  267. !           {
  268. !             if (*p == 'm')
  269. !               {
  270. !             string_appendn (&tname, "-", 1);
  271. !             p++;
  272. !               }
  273. !             while (isdigit (*p))    
  274. !               {
  275. !             string_appendn (&tname, p, 1);
  276. !             p++;
  277. !               }
  278. !           }
  279. !         else if (is_real)
  280. !           {
  281. !             if (*p == 'm')
  282. !               {
  283. !             string_appendn (&tname, "-", 1);
  284. !             p++;
  285. !               }
  286. !             while (isdigit (*p))    
  287. !               {
  288. !             string_appendn (&tname, p, 1);
  289. !             p++;
  290. !               }
  291. !             if (*p == '.') /* fraction */
  292. !               {
  293. !             string_appendn (&tname, ".", 1);
  294. !             p++;
  295. !             while (isdigit (*p))    
  296. !               {
  297. !                 string_appendn (&tname, p, 1);
  298. !                 p++;
  299. !               }
  300. !               }
  301. !             if (*p == 'e') /* exponent */
  302. !               {
  303. !             string_appendn (&tname, "e", 1);
  304. !             p++;
  305. !             while (isdigit (*p))    
  306. !               {
  307. !                 string_appendn (&tname, p, 1);
  308. !                 p++;
  309. !               }
  310. !               }
  311. !           }
  312. !         else if (is_pointer)
  313. !           {
  314. !             int symbol_len;
  315. !             
  316. !             if (!get_count (&p, &symbol_len))
  317. !               {
  318. !             success = 0;
  319. !             break;
  320. !               }
  321. !             string_appendn (&tname, p, symbol_len);
  322. !             p += symbol_len;
  323. !           }
  324. !           }
  325. !         need_comma = 1;
  326.         }
  327.       string_append (&tname, ">::");
  328.       if (destructor)
  329.         string_append(&tname, "~");
  330. !     if (constructor || destructor) {
  331. !       string_appendn (&trawname, "", 1);
  332. !       string_append (&tname, trawname.b);
  333. !     }
  334.       string_delete(&trawname);
  335. !     
  336.       if (!success) {
  337.         string_delete(&tname);
  338.         return 0;
  339.       }
  340. !     string_appendn (&tname, "", 1);
  341. !     string_prepend (&decl, tname.b);
  342.       string_delete (&tname);
  343.   
  344.       if (static_type)
  345. --- 424,468 ----
  346.         break;
  347.       /* template additions */
  348.       case 't':
  349. +     template:
  350.         p += 1;
  351.         {
  352. !     int r;
  353.       string tname;
  354.       string trawname;
  355.       
  356.       string_init(&tname);
  357.       string_init(&trawname);
  358.       /* get template name */
  359.       if (!get_simple_count (&p, &r))
  360.         {
  361. !         success = 0;
  362. !         break;
  363.         }
  364.       string_appendn (&tname, p, r);
  365.       string_appendn (&trawname, p, r);
  366.       p += r;
  367.       string_append (&tname, "<");
  368. !     success = do_template_args (&p, &tname);
  369. !     if (!success)
  370.         {
  371. !         string_delete (&tname);
  372. !         string_delete (&trawname);
  373. !         break;
  374.         }
  375.       string_append (&tname, ">::");
  376.       if (destructor)
  377.         string_append(&tname, "~");
  378. !     if (constructor || destructor)
  379. !       string_appends (&tname, &trawname);
  380.       string_delete(&trawname);
  381.       if (!success) {
  382.         string_delete(&tname);
  383.         return 0;
  384.       }
  385. !     string_prepends (&decl, &tname);
  386.       string_delete (&tname);
  387.   
  388.       if (static_type)
  389. ***************
  390. *** 602,609 ****
  391.         }
  392.       else
  393.         success = do_args (&p, &decl);
  394. !     break;
  395.         }
  396.       }
  397.   
  398.     for (i = 0; i < ntypes; i++)
  399. --- 473,482 ----
  400.         }
  401.       else
  402.         success = do_args (&p, &decl);
  403. !     if (const_flag)
  404. !       string_append (&decl, " const");
  405.         }
  406. +       break;
  407.       }
  408.   
  409.     for (i = 0; i < ntypes; i++)
  410. ***************
  411. *** 686,692 ****
  412.       case 'Q':
  413.         n = (*type)[1] - '0';
  414.         if (n < 0 || n > 9)
  415. !         success = 0;
  416.         *type += 2;
  417.         while (n-- > 0)
  418.           do_type (type, result);
  419. --- 559,568 ----
  420.       case 'Q':
  421.         n = (*type)[1] - '0';
  422.         if (n < 0 || n > 9)
  423. !         {
  424. !           success = 0;
  425. !           break;
  426. !         }
  427.         *type += 2;
  428.         while (n-- > 0)
  429.           do_type (type, result);
  430. ***************
  431. *** 842,850 ****
  432.       }
  433.   }
  434.   
  435. ! int
  436.   do_cuv_prefix (type, result, non_empty)
  437. !      char **type;
  438.        string* result;
  439.        int* non_empty;
  440.   {
  441. --- 718,726 ----
  442.       }
  443.   }
  444.   
  445. ! static int
  446.   do_cuv_prefix (type, result, non_empty)
  447. !      const char **type;
  448.        string* result;
  449.        int* non_empty;
  450.   {
  451. ***************
  452. *** 887,895 ****
  453.     return success;
  454.   }
  455.   
  456. ! int
  457.   do_builtin_type (type, result, non_empty)
  458. !      char **type;
  459.        string* result;
  460.        int *non_empty;
  461.   {
  462. --- 763,771 ----
  463.     return success;
  464.   }
  465.   
  466. ! static int
  467.   do_builtin_type (type, result, non_empty)
  468. !      const char **type;
  469.        string* result;
  470.        int *non_empty;
  471.   {
  472. ***************
  473. *** 991,996 ****
  474. --- 867,890 ----
  475.         string_appendn (result, *type, n);
  476.         *type += n;
  477.         break;
  478. +     case 't':
  479. +       *type += 1;
  480. +       /* get template name */
  481. +       if (!get_simple_count (type, &n))
  482. +     {
  483. +       success = 0;
  484. +       break;
  485. +     }
  486. +       if (*non_empty)
  487. +     string_append (result, " ");
  488. +       string_appendn (result, *type, n);
  489. +       *type += n;
  490. +       string_append (result, "<");
  491. +       if (!do_template_args (type, result))
  492. +     success = 0;
  493. +       else
  494. +     string_append (result, ">");
  495. +       break;
  496.       default:
  497.         success = 0;
  498.         break;
  499. ***************
  500. *** 998,1003 ****
  501. --- 892,1045 ----
  502.     return success;
  503.   }
  504.   
  505. + static int
  506. + do_template_args (type, result)
  507. +      const char **type;
  508. +      string *result;
  509. + {
  510. +   int r, i;
  511. +   string temp;
  512. +   int need_comma = 0;
  513. +   int success;
  514. +   /* get size of template parameter list */
  515. +   if (!get_count (type, &r))
  516. +     return 0;
  517. +   for (i = 0; i < r; i++)
  518. +     {
  519. +       if (need_comma)
  520. +     string_append (result, ", ");
  521. +       /* Z for type parameters */
  522. +       if (**type == 'Z')
  523. +     {
  524. +       *type += 1;
  525. +       success = do_type (type, &temp);
  526. +       if (success)
  527. +         string_appends (result, &temp);
  528. +       string_delete(&temp);
  529. +       if (!success)
  530. +         break;
  531. +     }
  532. +       /* otherwise, value parameter */
  533. +       else
  534. +     {
  535. +       const char *old_p  = *type;
  536. +       int is_pointer = 0;
  537. +       int is_real = 0;
  538. +       int is_integral = 0;
  539. +       int done = 0;
  540. +       success = do_type (type, &temp);
  541. +       if (success)
  542. +         string_appends (result, &temp);
  543. +       string_delete(&temp);
  544. +       if (!success)
  545. +         break;
  546. +       string_append (result, "=");
  547. +       while (*old_p && !done)
  548. +         {    
  549. +           switch (*old_p)
  550. +         {
  551. +         case 'P':
  552. +         case 'R':
  553. +           done = is_pointer = 1;
  554. +           break;
  555. +         case 'C':    /* const */
  556. +         case 'U':    /* unsigned */
  557. +         case 'V':    /* volatile */
  558. +         case 'F':    /* function */
  559. +         case 'M':    /* member function */
  560. +         case 'O':    /* ??? */
  561. +           old_p++;
  562. +           continue;
  563. +         case 'Q':    /* repetition of following */
  564. +         case 'T':    /* remembered type */
  565. +           abort();
  566. +           break;
  567. +         case 'v':    /* void */
  568. +           abort();
  569. +           break;
  570. +         case 'x':    /* long long */
  571. +         case 'l':    /* long */
  572. +         case 'i':    /* int */
  573. +         case 's':    /* short */
  574. +         case 'c':    /* char */
  575. +           done = is_integral = 1;
  576. +           break;
  577. +         case 'r':    /* long double */
  578. +         case 'd':    /* double */
  579. +         case 'f':    /* float */
  580. +           done = is_real = 1;
  581. +           break;
  582. +         default:
  583. +           abort();
  584. +         }
  585. +         }
  586. +       if (is_integral)
  587. +         {
  588. +           if (**type == 'm')
  589. +         {
  590. +           string_appendn (result, "-", 1);
  591. +           *type++;
  592. +         }
  593. +           while (isdigit (**type))    
  594. +         {
  595. +           string_appendn (result, *type, 1);
  596. +           *type++;
  597. +         }
  598. +         }
  599. +       else if (is_real)
  600. +         {
  601. +           if (**type == 'm')
  602. +         {
  603. +           string_appendn (result, "-", 1);
  604. +           *type++;
  605. +         }
  606. +           while (isdigit (**type))    
  607. +         {
  608. +           string_appendn (result, *type, 1);
  609. +           *type++;
  610. +         }
  611. +           if (**type == '.')    /* fraction */
  612. +         {
  613. +           string_appendn (result, ".", 1);
  614. +           *type++;
  615. +           while (isdigit (**type))    
  616. +             {
  617. +               string_appendn (result, *type, 1);
  618. +               *type++;
  619. +             }
  620. +         }
  621. +           if (**type == 'e')    /* exponent */
  622. +         {
  623. +           string_appendn (result, "e", 1);
  624. +           *type++;
  625. +           while (isdigit (**type))    
  626. +             {
  627. +               string_appendn (result, *type, 1);
  628. +               *type++;
  629. +             }
  630. +         }
  631. +         }
  632. +       else if (is_pointer)
  633. +         {
  634. +           int symbol_len;
  635. +           if (!get_count (type, &symbol_len))
  636. +         {
  637. +           success = 0;
  638. +           break;
  639. +         }
  640. +           string_appendn (result, *type, symbol_len);
  641. +           *type += symbol_len;
  642. +         }
  643. +     }
  644. +       need_comma = 1;
  645. +     }
  646. + }
  647.   /* `result' will be initialised in do_type; it will be freed on failure */
  648.   
  649.   static int
  650. ***************
  651. *** 1321,1327 ****
  652.     string_prependn (p, s, strlen (s));
  653.   }
  654.   
  655. - #if 0
  656.   static void
  657.   string_prepends (p, s)
  658.        string *p, *s;
  659. --- 1363,1368 ----
  660. ***************
  661. *** 1330,1336 ****
  662.       return;
  663.     string_prependn (p, s->b, s->p - s->b);
  664.   }
  665. - #endif
  666.   
  667.   static void
  668.   string_prependn (p, s, n)
  669. --- 1371,1376 ----
  670.